\(\int \frac {a+b \log (c (d (e+f x)^p)^q)}{(g+h x)^2} \, dx\) [425]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 80 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=\frac {b f p q \log (e+f x)}{h (f g-e h)}-\frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{h (g+h x)}-\frac {b f p q \log (g+h x)}{h (f g-e h)} \]

[Out]

b*f*p*q*ln(f*x+e)/h/(-e*h+f*g)+(-a-b*ln(c*(d*(f*x+e)^p)^q))/h/(h*x+g)-b*f*p*q*ln(h*x+g)/h/(-e*h+f*g)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2442, 36, 31, 2495} \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=-\frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{h (g+h x)}+\frac {b f p q \log (e+f x)}{h (f g-e h)}-\frac {b f p q \log (g+h x)}{h (f g-e h)} \]

[In]

Int[(a + b*Log[c*(d*(e + f*x)^p)^q])/(g + h*x)^2,x]

[Out]

(b*f*p*q*Log[e + f*x])/(h*(f*g - e*h)) - (a + b*Log[c*(d*(e + f*x)^p)^q])/(h*(g + h*x)) - (b*f*p*q*Log[g + h*x
])/(h*(f*g - e*h))

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2495

Int[((a_.) + Log[(c_.)*((d_.)*((e_.) + (f_.)*(x_))^(m_.))^(n_)]*(b_.))^(p_.)*(u_.), x_Symbol] :> Subst[Int[u*(
a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x], c*d^n*(e + f*x)^(m*n), c*(d*(e + f*x)^m)^n] /; FreeQ[{a, b, c, d, e,
f, m, n, p}, x] &&  !IntegerQ[n] &&  !(EqQ[d, 1] && EqQ[m, 1]) && IntegralFreeQ[IntHide[u*(a + b*Log[c*d^n*(e
+ f*x)^(m*n)])^p, x]]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {a+b \log \left (c d^q (e+f x)^{p q}\right )}{(g+h x)^2} \, dx,c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right ) \\ & = -\frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{h (g+h x)}+\text {Subst}\left (\frac {(b f p q) \int \frac {1}{(e+f x) (g+h x)} \, dx}{h},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right ) \\ & = -\frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{h (g+h x)}-\text {Subst}\left (\frac {(b f p q) \int \frac {1}{g+h x} \, dx}{f g-e h},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )+\text {Subst}\left (\frac {\left (b f^2 p q\right ) \int \frac {1}{e+f x} \, dx}{h (f g-e h)},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right ) \\ & = \frac {b f p q \log (e+f x)}{h (f g-e h)}-\frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{h (g+h x)}-\frac {b f p q \log (g+h x)}{h (f g-e h)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.86 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=\frac {-\frac {a}{g+h x}-\frac {b \log \left (c \left (d (e+f x)^p\right )^q\right )}{g+h x}+\frac {b f p q (\log (e+f x)-\log (g+h x))}{f g-e h}}{h} \]

[In]

Integrate[(a + b*Log[c*(d*(e + f*x)^p)^q])/(g + h*x)^2,x]

[Out]

(-(a/(g + h*x)) - (b*Log[c*(d*(e + f*x)^p)^q])/(g + h*x) + (b*f*p*q*(Log[e + f*x] - Log[g + h*x]))/(f*g - e*h)
)/h

Maple [A] (verified)

Time = 1.34 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.74

method result size
parallelrisch \(-\frac {\ln \left (f x +e \right ) x b \,f^{2} h p q -\ln \left (h x +g \right ) x b \,f^{2} h p q +\ln \left (f x +e \right ) b \,f^{2} g p q -\ln \left (h x +g \right ) b \,f^{2} g p q +\ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b e f h -\ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b \,f^{2} g +a e f h -a \,f^{2} g}{\left (e h -f g \right ) \left (h x +g \right ) f h}\) \(139\)

[In]

int((a+b*ln(c*(d*(f*x+e)^p)^q))/(h*x+g)^2,x,method=_RETURNVERBOSE)

[Out]

-(ln(f*x+e)*x*b*f^2*h*p*q-ln(h*x+g)*x*b*f^2*h*p*q+ln(f*x+e)*b*f^2*g*p*q-ln(h*x+g)*b*f^2*g*p*q+ln(c*(d*(f*x+e)^
p)^q)*b*e*f*h-ln(c*(d*(f*x+e)^p)^q)*b*f^2*g+a*e*f*h-a*f^2*g)/(e*h-f*g)/(h*x+g)/f/h

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.41 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=-\frac {a f g - a e h + {\left (b f g - b e h\right )} q \log \left (d\right ) - {\left (b f h p q x + b e h p q\right )} \log \left (f x + e\right ) + {\left (b f h p q x + b f g p q\right )} \log \left (h x + g\right ) + {\left (b f g - b e h\right )} \log \left (c\right )}{f g^{2} h - e g h^{2} + {\left (f g h^{2} - e h^{3}\right )} x} \]

[In]

integrate((a+b*log(c*(d*(f*x+e)^p)^q))/(h*x+g)^2,x, algorithm="fricas")

[Out]

-(a*f*g - a*e*h + (b*f*g - b*e*h)*q*log(d) - (b*f*h*p*q*x + b*e*h*p*q)*log(f*x + e) + (b*f*h*p*q*x + b*f*g*p*q
)*log(h*x + g) + (b*f*g - b*e*h)*log(c))/(f*g^2*h - e*g*h^2 + (f*g*h^2 - e*h^3)*x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 357 vs. \(2 (68) = 136\).

Time = 3.56 (sec) , antiderivative size = 357, normalized size of antiderivative = 4.46 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=\begin {cases} \frac {a x + \frac {b e \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f} - b p q x + b x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{g^{2}} & \text {for}\: h = 0 \\- \frac {a}{g h + h^{2} x} - \frac {b p q}{g h + h^{2} x} - \frac {b \log {\left (c \left (d \left (\frac {f g}{h} + f x\right )^{p}\right )^{q} \right )}}{g h + h^{2} x} & \text {for}\: e = \frac {f g}{h} \\- \frac {a e h}{e g h^{2} + e h^{3} x - f g^{2} h - f g h^{2} x} + \frac {a f g}{e g h^{2} + e h^{3} x - f g^{2} h - f g h^{2} x} - \frac {b e h \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{e g h^{2} + e h^{3} x - f g^{2} h - f g h^{2} x} + \frac {b f g p q \log {\left (\frac {g}{h} + x \right )}}{e g h^{2} + e h^{3} x - f g^{2} h - f g h^{2} x} + \frac {b f h p q x \log {\left (\frac {g}{h} + x \right )}}{e g h^{2} + e h^{3} x - f g^{2} h - f g h^{2} x} - \frac {b f h x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{e g h^{2} + e h^{3} x - f g^{2} h - f g h^{2} x} & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*ln(c*(d*(f*x+e)**p)**q))/(h*x+g)**2,x)

[Out]

Piecewise(((a*x + b*e*log(c*(d*(e + f*x)**p)**q)/f - b*p*q*x + b*x*log(c*(d*(e + f*x)**p)**q))/g**2, Eq(h, 0))
, (-a/(g*h + h**2*x) - b*p*q/(g*h + h**2*x) - b*log(c*(d*(f*g/h + f*x)**p)**q)/(g*h + h**2*x), Eq(e, f*g/h)),
(-a*e*h/(e*g*h**2 + e*h**3*x - f*g**2*h - f*g*h**2*x) + a*f*g/(e*g*h**2 + e*h**3*x - f*g**2*h - f*g*h**2*x) -
b*e*h*log(c*(d*(e + f*x)**p)**q)/(e*g*h**2 + e*h**3*x - f*g**2*h - f*g*h**2*x) + b*f*g*p*q*log(g/h + x)/(e*g*h
**2 + e*h**3*x - f*g**2*h - f*g*h**2*x) + b*f*h*p*q*x*log(g/h + x)/(e*g*h**2 + e*h**3*x - f*g**2*h - f*g*h**2*
x) - b*f*h*x*log(c*(d*(e + f*x)**p)**q)/(e*g*h**2 + e*h**3*x - f*g**2*h - f*g*h**2*x), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.12 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=b f p q {\left (\frac {\log \left (f x + e\right )}{f g h - e h^{2}} - \frac {\log \left (h x + g\right )}{f g h - e h^{2}}\right )} - \frac {b \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right )}{h^{2} x + g h} - \frac {a}{h^{2} x + g h} \]

[In]

integrate((a+b*log(c*(d*(f*x+e)^p)^q))/(h*x+g)^2,x, algorithm="maxima")

[Out]

b*f*p*q*(log(f*x + e)/(f*g*h - e*h^2) - log(h*x + g)/(f*g*h - e*h^2)) - b*log(((f*x + e)^p*d)^q*c)/(h^2*x + g*
h) - a/(h^2*x + g*h)

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.20 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=\frac {b f p q \log \left (f x + e\right )}{f g h - e h^{2}} - \frac {b f p q \log \left (h x + g\right )}{f g h - e h^{2}} - \frac {b p q \log \left (f x + e\right )}{h^{2} x + g h} - \frac {b q \log \left (d\right ) + b \log \left (c\right ) + a}{h^{2} x + g h} \]

[In]

integrate((a+b*log(c*(d*(f*x+e)^p)^q))/(h*x+g)^2,x, algorithm="giac")

[Out]

b*f*p*q*log(f*x + e)/(f*g*h - e*h^2) - b*f*p*q*log(h*x + g)/(f*g*h - e*h^2) - b*p*q*log(f*x + e)/(h^2*x + g*h)
 - (b*q*log(d) + b*log(c) + a)/(h^2*x + g*h)

Mupad [B] (verification not implemented)

Time = 3.32 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.11 \[ \int \frac {a+b \log \left (c \left (d (e+f x)^p\right )^q\right )}{(g+h x)^2} \, dx=-\frac {a}{x\,h^2+g\,h}-\frac {b\,\ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\right )}{h\,\left (g+h\,x\right )}+\frac {b\,f\,p\,q\,\mathrm {atan}\left (\frac {f\,g\,2{}\mathrm {i}+f\,h\,x\,2{}\mathrm {i}}{e\,h-f\,g}+1{}\mathrm {i}\right )\,2{}\mathrm {i}}{h\,\left (e\,h-f\,g\right )} \]

[In]

int((a + b*log(c*(d*(e + f*x)^p)^q))/(g + h*x)^2,x)

[Out]

(b*f*p*q*atan((f*g*2i + f*h*x*2i)/(e*h - f*g) + 1i)*2i)/(h*(e*h - f*g)) - (b*log(c*(d*(e + f*x)^p)^q))/(h*(g +
 h*x)) - a/(g*h + h^2*x)